Defaulting a Date Field to Today's Date

Description

Frequently, you will want to assign today's date as a default value to a field. There are two ways to do this using field rules.

Default Value

This procedure assigns a value, but only if the user does not input one first.

  1. Select the table in the Table/Sets tab of the Control Panel.

  2. Click Design > Field Rules.

  3. Select the field from the drop-down list box at the upper left corner of the dialog box.

  4. On the Data Entry tab, in the Default mode list, select "Simple default expression".

  5. Enter date() in the Default value field.

  6. Check At end of enter, set default value if field not touched by user.

  7. In the Position cursor at list select "End of selected text".

  8. Click 'X' to close and Yes to save your results.

    • The following picture shows the Field Rule configuration for the Date field of the Invoice_Header table.

      images/UG_Default_Date_2.gif

Calculated Field

This procedure may not be appropriate for all applications. Recalculating field rules will re-assign today's date to old records.

  1. Select the table in the Table/Sets tab of the Control Panel.

  2. Click Design > Field Rules.

  3. Select the field from the drop-down list box at the upper left corner of the dialog box.

  4. On the Field Types tab, in the Extended Field Types area, select Calculated.

  5. Enter date() in the Calculated field expression field.

  6. Click 'X' to Close and Yes to save your results.

  7. The following picture shows the Field Rule configuration for the Date field of the Invoice_Header table.

    images/UG_Default_Date.gif